package xyhoo.springframework.core.io.support;

import xyhoo.springframework.core.io.DefaultResourceLoader;
import xyhoo.springframework.core.io.ResourceLoader;
import xyhoo.springframework.util.Assert;

public class PathMatchingResourcePatternResolver implements ResourcePatternResolver {

    private final ResourceLoader resourceLoader;

    public PathMatchingResourcePatternResolver() {
        this.resourceLoader = new DefaultResourceLoader();
    }

    public PathMatchingResourcePatternResolver(ResourceLoader resourceLoader) {
        Assert.notNull(resourceLoader, "ResourceLoader must not be null");
        this.resourceLoader = resourceLoader;
    }

    @Override
    public ClassLoader getClassLoader() {
        return getResourceLoader().getClassLoader();
    }

    public ResourceLoader getResourceLoader() {
        return this.resourceLoader;
    }
}
